# $Id: PKGBUILD 87448 2013-03-31 20:30:15Z stephane $
# Maintainer: Stéphane Gaudreault <stephane@archlinux.org>

pkgname=cppcheck
pkgver=1.59
pkgrel=1
pkgdesc="A tool for static C/C++ code analysis"
arch=('i686' 'x86_64')
url="http://cppcheck.wiki.sourceforge.net/"
license=('GPL')
depends=('pcre' 'qt4')
makedepends=('docbook-xsl')
source=(http://downloads.sourceforge.net/sourceforge/${pkgname}/${pkgname}-${pkgver}.tar.bz2)
sha1sums=('686effdfa6f2ca3369d7d52e54c6fd2db2d06d97')

build() {
   cd "${srcdir}/${pkgname}-${pkgver}"
   make
   make DB2MAN=/usr/share/xml/docbook/xsl-stylesheets-1.78.0/manpages/docbook.xsl man

   cd gui
   export HAVE_RULES=yes 
   qmake-qt4
   make
}

package() {
   cd "${srcdir}/${pkgname}-${pkgver}"
   make DESTDIR="${pkgdir}" install

   install -D -p -m 644 cppcheck.1 "${pkgdir}"/usr/share/man/man1/cppcheck.1

   install -m755 gui/cppcheck-gui "${pkgdir}"/usr/bin
}
